﻿$(document).ready(function () {




    $(".h3").click(function () {

        if ($("#d" + this.id.toString()).find(".subpanel").height() == 24) { //If subpanel is already active...

            $("#d" + this.id.toString()).find(".subpanel").css({ 'height': 200 });
            $("#d" + this.id.toString()).find(".subpanel").css({ 'width': 250 });
        }
        else {

            $("#d" + this.id.toString()).find(".subpanel").css({ 'height': 24 });
            $("#d" + this.id.toString()).find(".subpanel").css({ 'width': 198 });
        }
    });

    $('#Button1').click(function () {
        $.ajax({
            type: "POST",
            url: "CarService.asmx/GetUser",
            data: "{}",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (response) {
                var cars = eval(response);
                $('#output').html(response.d);
                //                          $('#output').empty();
                //                          $.each(cars, function (index, car) {
                //                              $('#output').append(car);
                //                          });
            },
            failure: function (msg) {
                $('#output').text(msg);
            }
        });
    });



    $(".mesajci").click(function () {

        alert("wasdasd");
    });




});

function MesajPanasunuAc(denneme) {

    $(document).ready(function () {

        if ($("#d" + denneme.id.toString()).find(".subpanel").height() == 24) { //If subpanel is already active...

            $("#d" + denneme.id.toString()).find(".subpanel").css({ 'height': 200 });
            $("#d" + denneme.id.toString()).find(".subpanel").css({ 'width': 250 });
        }
        else {

            $("#d" + denneme.id.toString()).find(".subpanel").css({ 'height': 24 });
            $("#d" + denneme.id.toString()).find(".subpanel").css({ 'width': 198 });
        }
    });
}


function YeniMesajPanosuAc(id) {
    $(document).ready(function () {
        $.ajax({
            type: "POST",
            url: "CarService.asmx/YeniMesajPanosuAc",
            data: "{friendid:'" + id.toString() + "'}",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            cache: false,
            success: function (response) {

                $('#footpanel').html(response.d);

            },
            failure: function (msg) {
                $('#footpanel').text(msg);
            }
        });
    });

}



